package cn.bandeqing.payRecord.controller;

import cn.bandeqing.base.resp.Resp;
import cn.bandeqing.base.resp.Table;
import cn.bandeqing.payRecord.req.PayRecordTableReq;
import cn.bandeqing.payRecord.resp.PayRecordTable;
import cn.bandeqing.payRecord.rpc.IPayRecordRpc;
import cn.bandeqing.productType.req.ProductTypeSaveOrUpdateReq;
import cn.bandeqing.productType.req.ProductTypeTableReq;
import cn.bandeqing.productType.resp.ProductTypeTable;
import cn.bandeqing.productType.rpc.IProductTypeRpc;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/payRecord")
@RestController
@Tag(name = "支付记录")
public class PayRecordController {

    @DubboReference
    private IPayRecordRpc payRecordRpc;

    @Operation(summary = "表格")
    @PostMapping("/table")
    public Resp<Table<PayRecordTable>> table(@RequestBody @Valid PayRecordTableReq req) {
        return payRecordRpc.table(req);
    }

//    @Operation(summary = "创建或更新")
//    @PostMapping("/saveOrUpdate")
//    public Resp<Void> saveOrUpdate(@RequestBody @Valid ProductTypeSaveOrUpdateReq req) {
//        payRecordRpc.saveOrUpdate(req);
//        return Resp.success();
//    }

}
